// run: $exec < input
#include <iostream>

int sx, sy, ex, ey, t;

int main()
{
	std::cin >> t >> sx >> sy >> ex >> ey;
	for (int i = 0; i < t; i++) {
		char ch; std::cin >> ch;
		if (sx == ex && sy == ey) {
			std::cout << i << '\n';
			return 0;
		}
		if (ch == 'E' && sx < ex) sx++;
		if (ch == 'S' && sy > ey) sy--;
		if (ch == 'W' && sx > ex) sx--;
		if (ch == 'N' && sy < ey) sy++;
	}
	if (sx == ex && sy == ey)
		std::cout << t << '\n';
	else
		std::cout << "-1\n";
}

